package com.example.jpa.demo_jpa.service.impl;

import com.example.jpa.demo_jpa.model.Visit;
import com.example.jpa.demo_jpa.repository.VisitRepository;
import com.example.jpa.demo_jpa.service.VisitService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class VisitServiceImpl implements VisitService {
    @Resource
    VisitRepository visitRepository;

    @Override
    public Visit findById(String id) {
        return visitRepository.findById(id).orElse(null);
    }

    @Override
    public Visit save(Visit visit) {
        return visitRepository.save(visit);
    }
}
